Repository navigation
Runs that stop to ask: keep the questions, answer from CoderHelm, never ask twice - #330
Merged
Merged
Conversation
A run that stops as needs_input now stores what it asked on its record:
each question in plain words, why it blocks the change, and candidate
answers when the planner found any, plus a link to the comment it posted
on the ticket or issue. The planner is asked for that shape.
POST /api/runs/{run_id}/answer takes answers for those questions (members
and up), claims the run in one conditional write, starts the ticket again
with the answers on the message, and posts them on the ticket as
'<name> answered in CoderHelm:'. Triage and the planner read the answers
word for word; a plan that asks an answered question again is sent back
once, and answered questions are never stored or posted again.
The run API returns questions, questions_url, answers, answers_url and
continued_run_id; docs/api/openapi.json is regenerated.
The guard that stops when someone else's pull request for the ticket is open now reads the answers to its notice (replies on the Jira ticket or GitHub issue, newest first, and answers on the run page), has the model classify each as own / existing / unclear, and records the first clear one on the ticket's record. Every later run honours it: own opens CoderHelm's own pull request and leaves the other open; existing works on the other pull request's branch. Recorded decisions and earlier answers reach triage and the planner as resolved decisions. Before a plan's questions reach a person, the model judges each against them (covered, or CoderHelm's own call such as closing someone else's pull request); those are sent back once and then dropped. A notice already posted with the same text, or about the same pull request and not answered, is linked instead of posted again. The open pull request notice is a run-page question with its two choices; choosing one records the decision on the ticket.
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a run stops as "Needs your answer", the run page now shows exactly what is missing and takes the answer there. A run that stops to ask keeps its questions on the run (each in plain words, why it blocks the change, and candidate answers when the planner found any) with a link to the comment it posted. A new endpoint takes answers, posts them on the ticket as " answered in CoderHelm:", and continues the work with the answers in triage and planning context.
It also fixes a related loop: a person replied "go ahead and open your own" to the "A pull request is already open" notice, and a later run posted the same notice again and asked whether the other pull request should be closed. Replies to that notice are now read (by the model), recorded on the ticket and honoured on every later run. Settled questions are never asked again, and the same notice is never posted twice.
Changes
common::run_questions: questions, answers, validation, parsing the planner'sCLARIFICATION_NEEDED:blocks, the ticket reply text, and the "resolved decisions" section triage and the planner read.common::ticket_state:decisions(a person's choice on a notice, such asopen_pr:owner/name#Nown or existing) andnotices(what CoderHelm posted, so it isn't posted twice).resolved: the model judges each question a plan wants to ask against what is settled (covered, or CoderHelm's own call, such as closing someone else's PR). The plan is sent back once, and anything still covered is dropped from both the clarification and the decision's questions. If the model call fails, it falls back to comparing words.open_pr_choice: before branching, an open PR someone else made for the ticket is checked against the recorded decision. If there is none, replies to the notice are read newest first: run-page answers, Jira notes and GitHub issue comments after the notice. The model classifies each as own, existing or unclear, and the first clear one is recorded.ownopens CoderHelm's own PR and leaves the other open.existingworks on that PR's branch when it is in the same repo. Only an undecided PR stops the run.POST /api/runs/{run_id}/answer(members and up, therunscapability, public API). It takes answers, claims the run with a conditional write fromneeds_inputtoretried(so a second answer or a racing Retry gets409), queues the ticket with the answers under a pre-minted run id, then posts the reply (Jira app or GitHub). A choice made with a notice's button is recorded on the ticket at once.GET /api/runs/{run_id}returnsquestions(withdecision),questions_url,answers,answers_urlandcontinued_run_id.docs/api/openapi.jsonis regenerated.Verification
cargo fmt --check,cargo clippy --workspace --all-targets -D warningsandcargo test --workspaceall pass (common 1143, gateway 556, worker 711).get_runreturns them.